package com.itany.vo;

import java.util.List;

public class Menu {


    /**
     * 菜单id
     */
    private Integer menuid;
    /**
     * 菜单图标
     */
    private String icon;
    /**
     * 菜单名称
     */
    private String menuname;
    /**
     * 菜单访问路径（根菜单忽略）
     */
    private String url;
    /**
     * 子菜单列表
     */
    private List<Menu> menus;

    public Integer getMenuid() {
        return menuid;
    }

    public void setMenuid(Integer menuid) {
        this.menuid = menuid;
    }

    public String getIcon() {
        return icon;
    }

    public void setIcon(String icon) {
        this.icon = icon;
    }

    public String getMenuname() {
        return menuname;
    }

    public void setMenuname(String menuname) {
        this.menuname = menuname;
    }

    public String getUrl() {
        return url;
    }

    public void setUrl(String url) {
        this.url = url;
    }

    public List<Menu> getMenus() {
        return menus;
    }

    public void setMenus(List<Menu> menus) {
        this.menus = menus;
    }

    @Override
    public String toString() {
        return "Menu{" +
                "menuid=" + menuid +
                ", icon='" + icon + '\'' +
                ", menuname='" + menuname + '\'' +
                ", url='" + url + '\'' +
                ", sonMenus=" + menus +
                '}';
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        Menu menu = (Menu) o;

        return url != null ? url.equals(menu.url) : menu.url == null;
    }

    @Override
    public int hashCode() {
        return url != null ? url.hashCode() : 0;
    }
}
